<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>本元UI规范 | 孙加俊的个人博客</title>
    <meta name="generator" content="VuePress 1.8.2">
    <link rel="icon" href="/sjj-blog/favicon.ico">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    
    <link rel="preload" href="/sjj-blog/assets/css/0.styles.a5cb6817.css" as="style"><link rel="preload" href="/sjj-blog/assets/js/app.ab5bad9b.js" as="script"><link rel="preload" href="/sjj-blog/assets/js/3.136f62ef.js" as="script"><link rel="preload" href="/sjj-blog/assets/js/1.a27fba8e.js" as="script"><link rel="preload" href="/sjj-blog/assets/js/7.e5d26899.js" as="script"><link rel="prefetch" href="/sjj-blog/assets/js/10.9271e5b8.js"><link rel="prefetch" href="/sjj-blog/assets/js/11.67b9ea44.js"><link rel="prefetch" href="/sjj-blog/assets/js/12.f69e6353.js"><link rel="prefetch" href="/sjj-blog/assets/js/13.ace41b19.js"><link rel="prefetch" href="/sjj-blog/assets/js/14.78670b1e.js"><link rel="prefetch" href="/sjj-blog/assets/js/15.b0aaec82.js"><link rel="prefetch" href="/sjj-blog/assets/js/16.f0d479dc.js"><link rel="prefetch" href="/sjj-blog/assets/js/17.1bacbab3.js"><link rel="prefetch" href="/sjj-blog/assets/js/18.2237a65f.js"><link rel="prefetch" href="/sjj-blog/assets/js/19.7e0f4bf8.js"><link rel="prefetch" href="/sjj-blog/assets/js/20.5c098df8.js"><link rel="prefetch" href="/sjj-blog/assets/js/21.45bd5038.js"><link rel="prefetch" href="/sjj-blog/assets/js/4.cc582e42.js"><link rel="prefetch" href="/sjj-blog/assets/js/5.9c9443fe.js"><link rel="prefetch" href="/sjj-blog/assets/js/6.370fb6dd.js"><link rel="prefetch" href="/sjj-blog/assets/js/8.f6b78670.js"><link rel="prefetch" href="/sjj-blog/assets/js/9.d915a2b8.js">
    <link rel="stylesheet" href="/sjj-blog/assets/css/0.styles.a5cb6817.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container no-sidebar" data-v-1aefc0b4><div data-v-1aefc0b4><div id="loader-wrapper" class="loading-wrapper" data-v-d48f4d20 data-v-1aefc0b4 data-v-1aefc0b4><div class="loader-main" data-v-d48f4d20><div data-v-d48f4d20></div><div data-v-d48f4d20></div><div data-v-d48f4d20></div><div data-v-d48f4d20></div></div> <!----> <!----></div> <div class="password-shadow password-wrapper-out" style="display:none;" data-v-25ba6db2 data-v-1aefc0b4 data-v-1aefc0b4><h3 class="title" data-v-25ba6db2 data-v-25ba6db2>孙加俊的个人博客</h3> <p class="description" data-v-25ba6db2 data-v-25ba6db2></p> <label id="box" class="inputBox" data-v-25ba6db2 data-v-25ba6db2><input type="password" value="" data-v-25ba6db2> <span data-v-25ba6db2>Konck! Knock!</span> <button data-v-25ba6db2>OK</button></label> <div class="footer" data-v-25ba6db2 data-v-25ba6db2><span data-v-25ba6db2><i class="iconfont reco-theme" data-v-25ba6db2></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-25ba6db2>vuePress-theme-reco</a></span> <span data-v-25ba6db2><i class="iconfont reco-copyright" data-v-25ba6db2></i> <a data-v-25ba6db2><span data-v-25ba6db2>孙加俊</span>
            
          <span data-v-25ba6db2>2017 - </span>
          2023
        </a></span></div></div> <div class="hide" data-v-1aefc0b4><header class="navbar" data-v-1aefc0b4><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/sjj-blog/" class="home-link router-link-active"><img src="/sjj-blog/logo.png" alt="孙加俊的个人博客" class="logo"> <span class="site-name">孙加俊的个人博客</span></a> <div class="links"><div class="color-picker"><a class="color-button"><i class="iconfont reco-color"></i></a> <div class="color-picker-menu" style="display:none;"><div class="mode-options"><h4 class="title">Choose mode</h4> <ul class="color-mode-options"><li class="dark">dark</li><li class="auto active">auto</li><li class="light">light</li></ul></div></div></div> <div class="search-box"><i class="iconfont reco-search"></i> <input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/sjj-blog/" class="nav-link"><i class="iconfont reco-home"></i>
  首页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      技术栈
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/sjj-blog/categories/规范/" class="nav-link"><i class="undefined"></i>
  规范
</a></li><li class="dropdown-item"><!----> <a href="/sjj-blog/categories/原生JS/" class="nav-link"><i class="undefined"></i>
  原生JS
</a></li></ul></div></div><div class="nav-item"><a href="/sjj-blog/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      文档
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/sjj-blog/docs/theme-reco/" class="nav-link"><i class="undefined"></i>
  vuepress-reco
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      联系我
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://gitee.com/sir-jun" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-github"></i>
  Gitee
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask" data-v-1aefc0b4></div> <aside class="sidebar" data-v-1aefc0b4><div class="personal-info-wrapper" data-v-39576ba9 data-v-1aefc0b4><img src="/sjj-blog/avatar.png" alt="author-avatar" class="personal-img" data-v-39576ba9> <h3 class="name" data-v-39576ba9>
    孙加俊
  </h3> <div class="num" data-v-39576ba9><div data-v-39576ba9><h3 data-v-39576ba9>11</h3> <h6 data-v-39576ba9>Articles</h6></div> <div data-v-39576ba9><h3 data-v-39576ba9>3</h3> <h6 data-v-39576ba9>Tags</h6></div></div> <ul class="social-links" data-v-39576ba9></ul> <hr data-v-39576ba9></div> <nav class="nav-links"><div class="nav-item"><a href="/sjj-blog/" class="nav-link"><i class="iconfont reco-home"></i>
  首页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      技术栈
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/sjj-blog/categories/规范/" class="nav-link"><i class="undefined"></i>
  规范
</a></li><li class="dropdown-item"><!----> <a href="/sjj-blog/categories/原生JS/" class="nav-link"><i class="undefined"></i>
  原生JS
</a></li></ul></div></div><div class="nav-item"><a href="/sjj-blog/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      文档
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/sjj-blog/docs/theme-reco/" class="nav-link"><i class="undefined"></i>
  vuepress-reco
</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      联系我
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://gitee.com/sir-jun" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-github"></i>
  Gitee
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div></div> <!----></nav> <!----> </aside> <div class="password-shadow password-wrapper-in" style="display:none;" data-v-25ba6db2 data-v-1aefc0b4><h3 class="title" data-v-25ba6db2 data-v-25ba6db2>本元UI规范</h3> <!----> <label id="box" class="inputBox" data-v-25ba6db2 data-v-25ba6db2><input type="password" value="" data-v-25ba6db2> <span data-v-25ba6db2>Konck! Knock!</span> <button data-v-25ba6db2>OK</button></label> <div class="footer" data-v-25ba6db2 data-v-25ba6db2><span data-v-25ba6db2><i class="iconfont reco-theme" data-v-25ba6db2></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-25ba6db2>vuePress-theme-reco</a></span> <span data-v-25ba6db2><i class="iconfont reco-copyright" data-v-25ba6db2></i> <a data-v-25ba6db2><span data-v-25ba6db2>孙加俊</span>
            
          <span data-v-25ba6db2>2017 - </span>
          2023
        </a></span></div></div> <div data-v-1aefc0b4><main class="page"><section><div class="page-title"><h1 class="title">本元UI规范</h1> <div data-v-f875f3fc><i class="iconfont reco-account" data-v-f875f3fc><span data-v-f875f3fc>孙加俊</span></i> <i class="iconfont reco-date" data-v-f875f3fc><span data-v-f875f3fc>10/8/2023</span></i> <!----> <i class="tags iconfont reco-tag" data-v-f875f3fc><span class="tag-item" data-v-f875f3fc>规范</span></i></div></div> <div class="theme-reco-content content__default"><h1 id="本元ui规范"><a href="#本元ui规范" class="header-anchor">#</a> 本元UI规范</h1> <h3 id="_1、图片引用"><a href="#_1、图片引用" class="header-anchor">#</a> 1、图片引用</h3> <p>引用UI图的时候css尺寸按一倍图尺寸，资源使用2倍图或3倍图，icon图标类三倍图，大图二倍图。</p> <p><img src="/sjj-blog/assets/img/01.0988c868.png" alt="iamge"></p> <h3 id="_2、包裹class"><a href="#_2、包裹class" class="header-anchor">#</a> 2、包裹class</h3> <p>更改antdesign样式时，如果ant文档中该组件是<strong>不能指定外层class</strong>的组件，一定要在外层包一层class，避免样式污染。</p> <div class="language-less extra-class"><pre class="language-less"><code><span class="token comment">// 例：更改form表单中的label样式</span>
<span class="token selector">.my_pro_form</span> <span class="token punctuation">{</span>
  <span class="token selector">.ant-form-item-label</span> <span class="token punctuation">{</span>
    <span class="token selector">label</span> <span class="token punctuation">{</span>
      <span class="token property">color</span><span class="token punctuation">:</span> #171a1d<span class="token punctuation">;</span>
      <span class="token property">font-weight</span><span class="token punctuation">:</span> 600<span class="token punctuation">;</span>
      <span class="token property">font-size</span><span class="token punctuation">:</span> 14px<span class="token punctuation">;</span>
      <span class="token property">line-height</span><span class="token punctuation">:</span> 14px<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h3 id="_3、输入位数"><a href="#_3、输入位数" class="header-anchor">#</a> 3、输入位数</h3> <p>输入框中姓名、手机号、身份证号等适合限制位数的，前端需要限制输入位数，统一使用showCount+maxLength限制，不使用rule限定超出字数红字报错，无法确定位数的找产品确定。</p> <p><img src="/sjj-blog/assets/img/02.ff6e5eee.png" alt="iamge"></p> <h3 id="_4、input样式"><a href="#_4、input样式" class="header-anchor">#</a> 4、input样式</h3> <p>input、select和其他类似输入框，placeholder字号14px，输入字号14px，高度36px，圆角8px。placeholder内容为请输入/请选择+标题，选择时间区间为：请选择开始日期-请选择结束日期，使用自定义ProTable的不需特殊处理，</p> <p><img src="/sjj-blog/assets/img/12.b8bd157c.png" alt="iamge"></p> <p><img src="/sjj-blog/assets/img/13.c1e96153.png" alt="iamge"></p> <h3 id="_5、按钮样式"><a href="#_5、按钮样式" class="header-anchor">#</a> 5、按钮样式</h3> <p>非特殊按钮使用ant按钮组件，高度36px，8px圆角。颜色宽度已在global.less中更改</p> <p><img src="/sjj-blog/assets/img/11.5fab2d7f.png" alt="iamge"></p> <h3 id="_6、抽屉表单"><a href="#_6、抽屉表单" class="header-anchor">#</a> 6、抽屉表单</h3> <p>简单抽屉表单使用项目Pro组件库中的ProDrawerForm组件（参考入职管理页面)，抽屉开合可以使用visible控制也可以使用trigger控制，内部元素使用options渲染，项目中自定义组件不能实现功能的，统一使用ant的drawerForm组件，宽度600。</p> <blockquote><p>必须：外层包上className=&quot;my_pro_drawer_form&quot;</p></blockquote> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// 如下方按钮需要自定义：加上以下属性（部分版本文档没有此项）</span>
submitter<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span> <span class="token literal-property property">searchConfig</span><span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token literal-property property">submitText</span><span class="token operator">:</span> <span class="token string">'确认'</span><span class="token punctuation">,</span> <span class="token literal-property property">resetText</span><span class="token operator">:</span> <span class="token string">'取消'</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">}</span>
</code></pre></div><p><img src="/sjj-blog/assets/img/05.c48a390e.png" alt="iamge"></p> <div class="language-tsx extra-class"><pre class="language-tsx"><code><span class="token comment">//更改前上层引入iconfnt</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> IconFont <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@/utils/iconfontUrl.js'</span><span class="token punctuation">;</span>
<span class="token comment">//日期图标更改</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">RangePicker</span></span> <span class="token attr-name">suffixIcon</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">IconFont</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>icon-rili<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span><span class="token punctuation">}</span></span> <span class="token punctuation">/&gt;</span></span>
<span class="token comment">//下拉图标更改</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Select</span></span> <span class="token attr-name">suffixIcon</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">IconFont</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>icon-Vector<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span><span class="token punctuation">}</span></span> <span class="token punctuation">/&gt;</span></span>
</code></pre></div><h3 id="_7、表格组件"><a href="#_7、表格组件" class="header-anchor">#</a> 7、表格组件</h3> <p>table组件统一使用项目Pro组件库中的ProTable组件，标题/添加/特殊操作类按钮放在第一排使用myTitle传入，表格中不要配置scroll y轴滚动，超出使用浏览器自己的滚动条。</p> <div class="language-jsx extra-class"><pre class="language-jsx"><code><span class="token comment">// 所有表格类页面，当内容只有一页时不展示下方换页（ProTabel已处理）</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Table</span></span> <span class="token attr-name">pagination</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span> <span class="token literal-property property">hideOnSinglePage</span><span class="token operator">:</span> <span class="token boolean">true</span> <span class="token punctuation">}</span><span class="token punctuation">}</span></span> <span class="token punctuation">/&gt;</span></span>
</code></pre></div><p><img src="/sjj-blog/assets/img/06.58712048.png" alt="iamge"></p> <div class="language-tsx extra-class"><pre class="language-tsx"><code><span class="token comment">// 使用示例</span>
<span class="token operator">&lt;</span>ProTable
    myTitle<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span>
        name<span class="token operator">:</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">离职管理（待离职</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>resignStaffNumber<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">人）</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">,</span>
            <span class="token function-variable function">optionsBtnsRender</span><span class="token operator">:</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">(</span>
                <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Button</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>primary<span class="token punctuation">&quot;</span></span> <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token function">showDrawer</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">}</span></span><span class="token punctuation">&gt;</span></span><span class="token plain-text">
                    办理离职
                </span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span><span class="token class-name">Button</span></span><span class="token punctuation">&gt;</span></span>
            <span class="token punctuation">)</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">}</span>
    columns<span class="token operator">=</span><span class="token punctuation">{</span>columns<span class="token punctuation">}</span>
    request<span class="token operator">=</span><span class="token punctuation">{</span><span class="token keyword">async</span> <span class="token punctuation">(</span>params<span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
        <span class="token keyword">const</span> <span class="token punctuation">{</span> pageSize<span class="token punctuation">,</span> current<span class="token punctuation">,</span> departure_date_range<span class="token punctuation">,</span> member_name <span class="token punctuation">}</span> <span class="token operator">=</span> params<span class="token punctuation">;</span>
        <span class="token keyword">const</span> <span class="token punctuation">{</span> data <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">await</span> <span class="token function">getList</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
            params<span class="token operator">:</span> <span class="token punctuation">{</span>
                pageSize<span class="token punctuation">,</span>
                current<span class="token punctuation">,</span>
                keyword<span class="token operator">:</span> member_name
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token function">setResignStaffNumber</span><span class="token punctuation">(</span>data<span class="token operator">?.</span>total <span class="token operator">||</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">return</span> <span class="token punctuation">{</span>
            data<span class="token operator">:</span> data<span class="token punctuation">.</span>data<span class="token punctuation">,</span>
            success<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
            total<span class="token operator">:</span> data<span class="token punctuation">.</span>total<span class="token punctuation">,</span>
        <span class="token punctuation">}</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">}</span>
    rowKey<span class="token operator">=</span><span class="token string">&quot;id&quot;</span>
    search<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span>
        labelWidth<span class="token operator">:</span> <span class="token string">'auto'</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">}</span>
    scroll<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span> x<span class="token operator">:</span> <span class="token number">1500</span> <span class="token punctuation">}</span><span class="token punctuation">}</span>
    options<span class="token operator">=</span><span class="token punctuation">{</span><span class="token boolean">false</span><span class="token punctuation">}</span>
    pagination<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span>
        pageSize<span class="token operator">:</span> <span class="token number">10</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">}</span>
    headerTitle<span class="token operator">=</span><span class="token string">&quot;&quot;</span>
    toolBarRender<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">}</span>
    <span class="token operator">/</span><span class="token operator">&gt;</span>
</code></pre></div><p>表格columns中单项不要设置width: 'fit-content'，safari浏览器中不仅无效还会有渲染问题。
自定义渲染的表格项，没有值时渲染一个'-'，不要空在那里。
<img src="/sjj-blog/assets/img/09.054c1bd9.png" alt="iamge"></p> <h3 id="_8、确认弹窗"><a href="#_8、确认弹窗" class="header-anchor">#</a> 8、确认弹窗</h3> <p>确认弹窗类使用ant modal组件即可，标准样式参考下图。</p> <blockquote><p>必须：加上此属性：wrapClassName= &quot;makesure_modal&quot;</p></blockquote> <p><img src="/sjj-blog/assets/img/07.fc77e012.png" alt="iamge"></p> <div class="language-tsx extra-class"><pre class="language-tsx"><code><span class="token comment">// 使用示例</span>
<span class="token keyword">const</span> <span class="token punctuation">{</span> member_id <span class="token punctuation">}</span> <span class="token operator">=</span> record<span class="token punctuation">;</span>
<span class="token function">confirm</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
    className<span class="token operator">:</span> <span class="token string">'modal_tip middle'</span><span class="token punctuation">,</span>
    wrapClassName<span class="token operator">:</span> <span class="token string">'makesure_modal'</span><span class="token punctuation">,</span>
    title<span class="token operator">:</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">您是否确认删除该离职记录</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">,</span>
    content<span class="token operator">:</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">删除后该离职记录将作废，如需重新离职请再次发起离职审批。</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">,</span>
    icon<span class="token operator">:</span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">ExclamationCircleOutlined</span></span> <span class="token punctuation">/&gt;</span></span><span class="token punctuation">,</span>
    okText<span class="token operator">:</span> <span class="token string">'确 定'</span><span class="token punctuation">,</span>
    cancelText<span class="token operator">:</span> <span class="token string">'返 回'</span><span class="token punctuation">,</span>
    <span class="token function">onOk</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token function">deleteData</span><span class="token punctuation">(</span><span class="token punctuation">{</span> data<span class="token operator">:</span> <span class="token punctuation">{</span> member_id <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">then</span><span class="token punctuation">(</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span>res<span class="token operator">?.</span>code <span class="token operator">===</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                message<span class="token punctuation">.</span><span class="token function">success</span><span class="token punctuation">(</span><span class="token string">'删除成功'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                actionRef<span class="token operator">?.</span>current<span class="token operator">?.</span><span class="token function">reload</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
                message<span class="token punctuation">.</span><span class="token function">error</span><span class="token punctuation">(</span><span class="token string">'删除失败'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token function">onCancel</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token builtin">console</span><span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">'取消'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><h3 id="_9、面包屑导航"><a href="#_9、面包屑导航" class="header-anchor">#</a> 9、面包屑导航</h3> <p>面包屑导航：使用系统Pro组件库的ProBreadcrumb，如本页面导航中名字和菜单相同，直接使用即可，如果需要动态渲染，可传入title属性动态更改此菜单在面包屑中的名称。</p> <div class="language-html extra-class"><pre class="language-html"><code>// 默认使用
&lt;PageContainer pageHeaderRender={() =&gt; <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ProBreadcrumb</span> <span class="token punctuation">/&gt;</span></span>}&gt;
</code></pre></div><div class="language-html extra-class"><pre class="language-html"><code>//动态渲染使用
&lt;PageContainer
      pageHeaderRender={() =&gt; 
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ProBreadcrumb</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span>{formId</span> <span class="token attr-name">?</span> <span class="token attr-name">'编辑流程表单'</span> <span class="token attr-name">:</span> <span class="token attr-name">'创建流程表单'}</span> <span class="token punctuation">/&gt;</span></span>
      }
    &gt;
</code></pre></div><h3 id="_10、弹窗表单"><a href="#_10、弹窗表单" class="header-anchor">#</a> 10、弹窗表单</h3> <p>modal内有表单的使用ProModal组件，如有样式不合适的项，在global.less中的my_pro_modal中修改。
<img src="/sjj-blog/assets/img/08.4d59fdcb.png" alt="iamge"></p> <h3 id="_11、选择部门-成员-重要"><a href="#_11、选择部门-成员-重要" class="header-anchor">#</a> 11、选择部门/成员（重要）</h3> <p>选择部门和成员的统一使用ChooseMember中的ChooseWidget组件渲染（组件内内有示例)。</p> <p><img src="/sjj-blog/assets/img/10.9d14b768.png" alt="iamge"></p> <div class="language-tsx extra-class"><pre class="language-tsx"><code><span class="token comment">// 使用示例</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Form.Item</span></span>
    <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>demo4<span class="token punctuation">&quot;</span></span>
    <span class="token attr-name">label</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>单选案例<span class="token punctuation">&quot;</span></span>
    <span class="token attr-name">initialValue</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span>
        value<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span>
    <span class="token punctuation">}</span><span class="token punctuation">}</span></span>
    <span class="token punctuation">&gt;</span></span><span class="token plain-text">
    </span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">ChooseWidget</span></span>
        <span class="token attr-name">defaultData</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>data2<span class="token punctuation">}</span></span>
        <span class="token attr-name">chooseType</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">'</span>memberDepartment<span class="token punctuation">'</span></span>
        <span class="token attr-name">mode</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>radio<span class="token punctuation">&quot;</span></span>
        <span class="token punctuation">/&gt;</span></span><span class="token plain-text">
</span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span><span class="token class-name">Form.Item</span></span><span class="token punctuation">&gt;</span></span>
</code></pre></div><h3 id="_12、待更新"><a href="#_12、待更新" class="header-anchor">#</a> 12、待更新</h3></div></section> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/1/2023, 1:36:46 PM</span></div></footer> <!----> <div class="comments-wrapper"><!----></div> <ul class="side-bar sub-sidebar-wrapper" style="width:12rem;" data-v-cb1513f6><li class="level-3" data-v-cb1513f6><a href="/sjj-blog/blogs/standards/UI-standards.html#_1、图片引用" class="sidebar-link reco-side-_1、图片引用" data-v-cb1513f6>1、图片引用</a></li><li class="level-3" data-v-cb1513f6><a href="/sjj-blog/blogs/standards/UI-standards.html#_2、包裹class" class="sidebar-link reco-side-_2、包裹class" data-v-cb1513f6>2、包裹class</a></li><li class="level-3" data-v-cb1513f6><a href="/sjj-blog/blogs/standards/UI-standards.html#_3、输入位数" class="sidebar-link reco-side-_3、输入位数" data-v-cb1513f6>3、输入位数</a></li><li class="level-3" data-v-cb1513f6><a href="/sjj-blog/blogs/standards/UI-standards.html#_4、input样式" class="sidebar-link reco-side-_4、input样式" data-v-cb1513f6>4、input样式</a></li><li class="level-3" data-v-cb1513f6><a href="/sjj-blog/blogs/standards/UI-standards.html#_5、按钮样式" class="sidebar-link reco-side-_5、按钮样式" data-v-cb1513f6>5、按钮样式</a></li><li class="level-3" data-v-cb1513f6><a href="/sjj-blog/blogs/standards/UI-standards.html#_6、抽屉表单" class="sidebar-link reco-side-_6、抽屉表单" data-v-cb1513f6>6、抽屉表单</a></li><li class="level-3" data-v-cb1513f6><a href="/sjj-blog/blogs/standards/UI-standards.html#_7、表格组件" class="sidebar-link reco-side-_7、表格组件" data-v-cb1513f6>7、表格组件</a></li><li class="level-3" data-v-cb1513f6><a href="/sjj-blog/blogs/standards/UI-standards.html#_8、确认弹窗" class="sidebar-link reco-side-_8、确认弹窗" data-v-cb1513f6>8、确认弹窗</a></li><li class="level-3" data-v-cb1513f6><a href="/sjj-blog/blogs/standards/UI-standards.html#_9、面包屑导航" class="sidebar-link reco-side-_9、面包屑导航" data-v-cb1513f6>9、面包屑导航</a></li><li class="level-3" data-v-cb1513f6><a href="/sjj-blog/blogs/standards/UI-standards.html#_10、弹窗表单" class="sidebar-link reco-side-_10、弹窗表单" data-v-cb1513f6>10、弹窗表单</a></li><li class="level-3" data-v-cb1513f6><a href="/sjj-blog/blogs/standards/UI-standards.html#_11、选择部门-成员-重要" class="sidebar-link reco-side-_11、选择部门-成员-重要" data-v-cb1513f6>11、选择部门/成员（重要）</a></li><li class="level-3" data-v-cb1513f6><a href="/sjj-blog/blogs/standards/UI-standards.html#_12、待更新" class="sidebar-link reco-side-_12、待更新" data-v-cb1513f6>12、待更新</a></li></ul></main> <!----></div></div></div></div><div class="global-ui"><div class="back-to-ceiling" style="right:1rem;bottom:6rem;width:2.5rem;height:2.5rem;border-radius:.25rem;line-height:2.5rem;display:none;" data-v-c6073ba8 data-v-c6073ba8><svg t="1574745035067" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5404" class="icon" data-v-c6073ba8><path d="M526.60727968 10.90185116a27.675 27.675 0 0 0-29.21455937 0c-131.36607665 82.28402758-218.69155461 228.01873535-218.69155402 394.07834331a462.20625001 462.20625001 0 0 0 5.36959153 69.94390903c1.00431239 6.55289093-0.34802892 13.13561351-3.76865779 18.80351572-32.63518765 54.11355614-51.75690182 118.55860487-51.7569018 187.94566865a371.06718723 371.06718723 0 0 0 11.50484808 91.98906777c6.53300375 25.50556257 41.68394495 28.14064038 52.69160883 4.22606766 17.37162448-37.73630017 42.14135425-72.50938081 72.80769204-103.21549295 2.18761121 3.04276886 4.15646224 6.24463696 6.40373557 9.22774369a1871.4375 1871.4375 0 0 0 140.04691725 5.34970492 1866.36093723 1866.36093723 0 0 0 140.04691723-5.34970492c2.24727335-2.98310674 4.21612437-6.18497483 6.3937923-9.2178004 30.66633723 30.70611158 55.4360664 65.4791928 72.80769147 103.21549355 11.00766384 23.91457269 46.15860503 21.27949489 52.69160879-4.22606768a371.15156223 371.15156223 0 0 0 11.514792-91.99901164c0-69.36717486-19.13165746-133.82216804-51.75690182-187.92578088-3.42062944-5.66790279-4.76302748-12.26056868-3.76865837-18.80351632a462.20625001 462.20625001 0 0 0 5.36959269-69.943909c-0.00994388-166.08943902-87.32547796-311.81420293-218.6915546-394.09823051zM605.93803103 357.87693858a93.93749974 93.93749974 0 1 1-187.89594924 6.1e-7 93.93749974 93.93749974 0 0 1 187.89594924-6.1e-7z" p-id="5405" data-v-c6073ba8></path><path d="M429.50777625 765.63860547C429.50777625 803.39355007 466.44236686 1000.39046097 512.00932183 1000.39046097c45.56695499 0 82.4922232-197.00623328 82.5015456-234.7518555 0-37.75494459-36.9345906-68.35043303-82.4922232-68.34111062-45.57627738-0.00932239-82.52019037 30.59548842-82.51086798 68.34111062z" p-id="5406" data-v-c6073ba8></path></svg></div></div></div>
    <script src="/sjj-blog/assets/js/app.ab5bad9b.js" defer></script><script src="/sjj-blog/assets/js/3.136f62ef.js" defer></script><script src="/sjj-blog/assets/js/1.a27fba8e.js" defer></script><script src="/sjj-blog/assets/js/7.e5d26899.js" defer></script>
  </body>
</html>
